package hypeerweb.node;

import hypeerweb.SimplifiedNodeDomain;
import hypeerweb.visitor.Parameters;
import hypeerweb.visitor.Visitor;

public interface NodeInterface {

	/**
	 * Creates a simplified node domain to be used in testing.
	 * 
	 * @return Returns the constructed simplified node domain.
	 * @pre None.
	 * @post The simplified node domain attributes correspond to this node's
	 *       attributes.
	 */
	public abstract SimplifiedNodeDomain constructSimplifiedNodeDomain();

	/**
	 * Adds the node newNode to the HyPeerWeb, using this node as the starting
	 * node.
	 * 
	 * @param newNode
	 *            The node to be added to the HyPeerWeb.
	 * @pre newNode is not null.
	 * @post + The size of the HyPeer Web is N+1 where N is the original size of
	 *       the web. + The new node's webID is N. + All of the constraints are
	 *       true. + The webIDs of the original nodes in the HyPeerWeb do not
	 *       change.
	 */
	public abstract void addToHyPeerWeb(Node newNode);

	/**
	 * Adds a neighbor.
	 * 
	 * @param neighbor
	 *            The Node to be added as a neighbor.
	 */
	public abstract void addNeighbor(Node neighbor);

	/**
	 * Removes a neighbor.
	 * 
	 * @param neighbor
	 *            The Node to be removed as a neighbor.
	 */
	public abstract void removeNeighbor(Node neighbor);

	/**
	 * Adds an upPointer.
	 * 
	 * @param upPointer
	 *            The Node to be added as an upPointer.
	 */
	public abstract void addUpPointer(Node upPointer);

	/**
	 * Removes an upPointer.
	 * 
	 * @param upPointer
	 *            The Node to be removed as an upPointer.
	 */
	public abstract void removeUpPointer(Node upPointer);

	/**
	 * Adds a downPointer.
	 * 
	 * @param downPointer
	 *            The Node to be added as an downPointer.
	 */
	public abstract void addDownPointer(Node downPointer);

	/**
	 * Removes a downPointer.
	 * 
	 * @param downPointer
	 *            The Node to be removed as an downPointer.
	 */
	public abstract void removeDownPointer(Node downPointer);

	/**
	 * Sets the fold for this node.
	 * 
	 * @param newFold
	 *            The Node to be set as the fold.
	 */
	public abstract void setFold(Node newFold);

	/**
	 * Sets the surrogate fold for this node.
	 * 
	 * @param newSurrogateFold
	 *            The Node to be set as the surrogate fold.
	 */
	public abstract void setSurrogateFold(Node newSurrogateFold);

	/**
	 * Sets the inverse surrogate fold for this node.
	 * 
	 * @param newInverseSurrogateFold
	 *            The Node to be set as the inverse. surrogate fold.
	 */
	public abstract void setInverseSurrogateFold(Node newInverseSurrogateFold);

	/**
	 * Gets the WebId for this node.
	 * 
	 * @return Returns the node's webId.
	 */
	public abstract WebId getWebId();

	/**
	 * Sets the WebId for this Node.
	 * 
	 * @param id
	 *            The WebId to be set to the node.
	 */
	public abstract void setWebId(WebId id);

	/**
	 * Returns a string representation of the Node.
	 * 
	 * @return Returns the webId string
	 */
	public abstract String toString();

	public abstract void removeFromHyPeerWeb();

	public abstract void setState(NodeState state);

	public abstract NodeState getState();
	
	public abstract Node asNode();
	
	public abstract Contents getContents();
	
	public void accept(Visitor visitor, Parameters parameters);

}